﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Customer : System.Web.UI.Page
{
    private SOAWebService.Service1 ser = new SOAWebService.Service1();
    
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindData();
        }
    }

    public void BindData()
    {
        GridView1.DataSource = ser.GetAllCustomer();
        GridView1.DataBind();
    }


   
    protected void btnSelect_Click(object sender, EventArgs e)
    {
        SOAWebService.Customer cus = new SOAWebService.Customer();
        cus.CustomerID = txtID.Text;
        cus.CustomerName = txtName.Text;
        cus.CustomerTel = txtTel.Text;
        cus.CustomerEmail = txtEmail.Text;
        cus.Vehicle = txtVehicle.Text;
        GridView1.DataSource = ser.GetCustomerByInfo(cus);
        GridView1.DataBind();
    }
}
